package com.jxy.homepage.config.druid;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * DruidConfig
 *
 * @author Jxy
 * @date 2022/1/5
 * @Description druid数据源配置类
 */
@Configuration
public class DruidConfig {
    private static final String DB_PREFIX = "spring.datasource";

    @Bean
    @ConfigurationProperties(value = DB_PREFIX)
    public DataSource dbDataSource() {
        return new DruidDataSource();
    }
}